<template>
	<scroll-view 
	:refresherEnabled = refresherEnabled
	:refresherTriggered = refresherTriggered
	@scrolltolower="emit('scrolltolower',$event)"
	@refresherrefresh="emit('refresherrefresh',$event)"
	:style="{height:windowHeight + 'px',backgroundColor:backgroundColor ,borderBottom:borderStyle,boxSizing: 'border-box'}"
	scroll-y 
	>
		<view class="scorllContent">
			<slot></slot>
		</view>
	</scroll-view>
</template>

<script setup>
const {windowHeight}=uni.getSystemInfoSync()
defineProps({
	// 接收设置底边框
	borderStyle:{
		type:[String,Boolean],
	    default:false
	},
	// 是否开启刷新
	refresherEnabled:{
		type:Boolean,
		default:false
	},
	// 刷新状态
	refresherTriggered:{
		type:Boolean,
		default:false
	},
	// 背景颜色
	backgroundColor:{
		type:String,
		default:'#fff'
	}
	
})
// 发射事件
const emit = defineEmits(['scrolltolower','refresherrefresh'])
</script>

<style lang="scss">
.scorllContent{
	padding-bottom:env(safe-area-inset-bottom) ;
}
</style>